package com.sdl.dagger.di.module;

import android.content.Context;
import android.view.WindowManager;

import com.sdl.dagger.DaggerApplication;
import com.sdl.dagger.data.Person;
import com.sdl.dagger.di.annotation.Boy;
import com.sdl.dagger.di.annotation.Girl;

import javax.inject.Named;
import javax.inject.Singleton;

import dagger.Module;
import dagger.Provides;

/**
 * Created by 11870 on 2017/3/6.
 */
@Module
public class AndroidModule {

    private final DaggerApplication mApplication ;

    public AndroidModule(DaggerApplication application) {
        mApplication = application;
    }

    @Provides
    @Singleton
    Context provideContext(){
        return mApplication ;
    }

    @Provides
    @Singleton
    WindowManager provideWindowManager(){
        return (WindowManager) mApplication.getSystemService(Context.WINDOW_SERVICE);
    }

    @Boy
    @Provides
    @Singleton
    Person provideBoy(){
        return new Person(0);
    }

    @Girl
    @Provides
    @Singleton
    Person provideGirl(){
        return new Person(1);
    }
}
